import type { IDict } from "~/types/common";
import { request } from "~/utils/http";

export const apiDictTree = (): Promise<IDict[]> => request.get("/dicts/tree");

export const apiAddDict = (data: Partial<IDict>) =>
  request.post("/dicts", data);

export const apiModifyDict = (id: number, data: Partial<IDict>) =>
  request.put(`/dicts/${id}`, data);
